/********************************************************************
	created:	2014/08/05
	created:	5:8:2014   15:34
	filename: 	e:\WorkCode\QuoteBoard V6\include\SSQBQuote.h
	file path:	e:\WorkCode\QuoteBoard V6\include
	file base:	SSQBQuote
	file ext:	h
	author:		Alger
	
	purpose:	兴业报价客户端和服务端的接口
*********************************************************************/
#pragma once
#include "SSQBModel.h"
#include <list>
#include "qbprotocol/include/variant.h"


//E_FID_QB_BOND_BC_INFO						= 54000,			// QB 查询报价方的机构信息，tong
class xQBBondBCContact_c{
public:
	char		m_Name[32];						//联系人名字
	char		m_DisplayName[64];				//显示联系人名字
	char		m_TEL[32];						//电话
	char		m_Mobile[16];					//手机
	char		m_Mail[32];						//邮箱
	char		m_QM[64];						//QM
	xQBBondBCContact_c(){
		memset(this,0,sizeof(xQBBondBCContact_c));
	}
};

class xQBBondBCUnit_c{
public:
	char		m_BCCompanyID[32+1];			//机构ID
	char		m_BCCode[32+1];					//机构代码
	char		m_BCName[64];					//机构名称
	char		m_BCDetail[1024];				//机构简介
	std::list<xQBBondBCContact_c>	m_Contact;	//联系人列表
	xQBBondBCUnit_c(){
		m_BCCompanyID[0]='\0';
		m_BCCode[0]='\0';
		m_BCName[0]='\0';
		m_BCDetail[0]='\0';
	}
};

class xQBBondBCInfoReq_c {
public:
	char		m_QBUserID[32+1];				//用户ID
	char		m_QBCompanyID[32+1];			//机构ID
};

class xQBBondBCInfoAck_c{
public:
	std::list<xQBBondBCUnit_c> m_BCList;
};

//--------------------------------------------------------
//E_FID_QB_BOND_QUOTE								= 54001,			// QB 报价，anson
class xQBBondID_c{
public:
	char		m_BondKey[32+1];				//bondkey
	char		m_BondCode[12];					//债券代码
	char		m_ListedMarket[8];				//市场
	xQBBondID_c(){
		m_BondKey[0]='\0';
		m_BondCode[0]='\0';
		m_ListedMarket[0]='\0';
	}
};

class xQBBondQuote_c{
public:
	char		m_BondKey[32+1];				//bondkey
	char		m_BondCode[12];					//债券代码
	char		m_ListedMarket[8];				//市场

	char		m_Bid[10];						//bid报价
	char		m_BidYield[10];					//bid收益率，anson填
	char		m_BidClean[10];					//bid净价，anson填
	char		m_BidFull[10];					//bid全价，anson填
	char		m_BidVol[12];					//bid数量
	char		m_BidStatus[4];					//bid状态，0--无报价，1--正常，-1--refer

	char		m_Ofr[10];						//ofr报价
	char		m_OfrYield[10];					//ofr收益率，anson填
	char		m_OfrClean[10];					//ofr净价，anson填
	char		m_OfrFull[10];					//ofr全价，anson填
	char		m_OfrVol[12];					//ofr数量
	char		m_OfrStatus[4];					//ofr状态，0--无报价，1--正常,-1--refer

	char		m_Operation[4];					//报价标志，0--new，1--refer，2--unrefer，3--update(refresh),4--add 1,5--reduce1,6-move1,7--move-1,8--modify
	char		m_BCUserID[32+1];				//报价用户ID
	time_t		m_Time;							//价格最新时间，服务端时间
	xQBBondQuote_c(){
		memset(this,0,sizeof(xQBBondQuote_c));
	}
};

class xQBBondQuoteReq_c {
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondQuote_c> m_list;			//报价列表
};

class xQBBondQuoteAck_c{
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondQuote_c> m_List;			//报价列表
};

//--------------------------------------------------------
//E_FID_QB_BOND_PUBLISH_STATUS_CHG			= 54002,			// QB 报价状态改变，发布中和冻结的切换，anson
class xQBBondPublishStatusChgReq_c {
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	char		m_Publish[4];					//发布状态，1--发布中，0--冻结
	time_t		m_Time;							//状态设置时间
	xQBBondPublishStatusChgReq_c(){
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_Publish[0]='\0';
		m_Time=0;
	}
};

class xQBBondPublishStatusAck_c{
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	char		m_Publish[4];					//发布状态，1--发布中，0--冻结
	time_t		m_Time;							//状态设置时间
	xQBBondPublishStatusAck_c(){
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_Publish[0]='\0';
		m_Time=0;
	}
};

//--------------------------------------------------------
//E_FID_QB_BOND_PUBLISH_STATUS_REQ			= 54017,			// QB 查询发布中还是冻结状态
//应答同 E_FID_QB_BOND_PUBLISH_STATUS_CHG			= 54002
class xQBBondPublishStatusReq_c {
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
};

//--------------------------------------------------------
//E_FID_QB_BOND_PUBLISH_STATUS_CHG_PUSH		= 54027				// QB 报价状态改变,推送
//应答同 E_FID_QB_BOND_PUBLISH_STATUS_CHG			= 54002

//--------------------------------------------------------
//E_FID_QB_BOND_SET_TOP						= 54003,			// QB 设置券的置顶，tong
class xQBBondSetTopReq_c{
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondID_c>	m_list;				//设置的标签
	int			m_TopFlag;	//0--取消置顶，1--置顶
	xQBBondSetTopReq_c(){
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_TopFlag = 0;
	}

};

class xQBBondSetTopAck_c{
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondID_c>	m_list;				//设置的标签
	int			m_TopFlag;						//0--取消置顶，1--置顶

	xQBBondSetTopAck_c(){
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_TopFlag = 0;
	}
};//应答需要入库，同时推送给其他用户

//--------------------------------------------------------
//E_FID_QB_BOND_TOP_QUERY						=54014				// QB 查询置顶的券，tong
class xQBBondTopReq_c{
public:
	char		m_UserID[32+1];					//用户ID，QB或BC的用户ID
	char		m_BCCompanyID[32+1];			//机构ID
};

class xQBBondTopAck_c{
public:
	char		m_UserID[32+1];					//用户ID，QB或BC的用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondID_c>	m_List;				//设置的标签
	xQBBondTopAck_c()
	{
		m_UserID[0]='\0';
		m_BCCompanyID[0]='\0';
	}

};//

//--------------------------------------------------------
//E_FID_QB_BOND_NOTICE_PUBLISH					= 54004,		// QB 发布公告，tong
//E_FID_QB_BOND_NOTICE_MODIFY					= 54005,		// QB 修改公告，tong
class xQBBondNoticePublishReq_c{
public:
	char		m_ID[32+1];						//序列号,修改的时候需要设置ID
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	char		m_Notice[512];					//内容
	time_t		m_Time;							//时间
	xQBBondNoticePublishReq_c(){
		m_ID[0]='\0';
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_Notice[0]='\0';
		m_Time = 0;
	}
};

class xQBBondNoticePublishAck_c{
public:
	char		m_ID[32+1];						//序列号,修改的时候需要设置ID
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	char		m_Notice[512];					//内容
	time_t		m_Time;							//时间
	xQBBondNoticePublishAck_c(){
		m_ID[0]='\0';
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_Notice[0]='\0';
		m_Time = 0;
	}


};//应答需要入库、更新库，同时推送给其他用户

//--------------------------------------------------------
//E_FID_QB_BOND_NOTICE_DEL					= 54006,			// QB 删除公告，tong
class xQBBondNoticeDelReq_c{
public:
	char		m_ID[32+1];						//序列号,修改的时候需要设置ID
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	time_t		m_Time;							//时间
	xQBBondNoticeDelReq_c(){
		m_ID[0]='\0';
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_Time = 0;
	}


};

class xQBBondNoticeDelAck_c{
public:
	char		m_ID[32+1];						//序列号,修改的时候需要设置ID
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	time_t		m_Time;							//时间
	xQBBondNoticeDelAck_c(){
		m_ID[0]='\0';
		m_BCUserID[0]='\0';
		m_BCCompanyID[0]='\0';
		m_Time = 0;
	}

};//应答需要更新库，同时推送给其他用户

//--------------------------------------------------------
//E_FID_QB_BOND_NOTICE_QUERY					= 54007,			// QB 查询公告，tong
class xQBBondNoticeQueryReq_c{
public:
	char		m_QBUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	time_t		m_BeginTime;					//查询开始时间，-1，从最早开始
};

class xQBBondNoticeUnit_c{
public:
	char		m_ID[32+1];						//序列号
	char		m_Notice[512];					//内容
	time_t		m_Time;							//时间
};//应答需要入库、更新库，同时推送给其他用户

class xQBBondNoticeQueryAck_c{
public:
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondNoticeUnit_c>	m_List;		//公告列表
	xQBBondNoticeQueryAck_c()
	{
		m_BCCompanyID[0] = '\0';
	}
};

//--------------------------------------------------------
//E_FID_QB_BOND_QUOTE_QUERY_QB					= 54008,				// QB 查询报价，anson
class xQBBondQuoteQueryQBReq_c{
public:
	char		m_QBUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondID_c>	m_list;				//查询的券，如果List为空，则查询所有
	xQBBondQuoteQueryQBReq_c(){
		m_QBUserID[0]='\0';
		m_BCCompanyID[0]='\0';
	}
};

class xQBBondQuoteQueryAck_c{
public:
	char		m_BCCompanyID[32+1];			//机构ID
	std::list<xQBBondQuote_c>	m_List;			//价格列表
	xQBBondQuoteQueryAck_c(){
		m_BCCompanyID[0]='\0';
	}
};

//--------------------------------------------------------
//E_FID_QB_BOND_QUOTE_QUERY_BC					= 54009,				// BC 查询报价，anson
class xQBBondQuoteQueryBCReq_c{
public:
	char		m_BCUserID[32+1];				//用户ID
	char		m_BCCompanyID[32+1];			//机构ID
	int			m_BeforeDays;					//查询最近的天数,过滤掉m_BeforeDays 天前的报价
};
//应答同54008


//E_FID_QB_BOND_QUOTE_PUSH_TO_QB				= 54010,			// QB 报价推送，推送给QB展示页面
//E_FID_QB_BOND_QUOTE_PUSH_TO_BC				= 54011,			// QB 报价推送，推送给BC报价页面
//E_FID_QB_BOND_QUOTE_PUSH_TO_QB_CANCEL			= 54012,			// QB 报价推送，推送给QB展示页面,注册取消
//E_FID_QB_BOND_QUOTE_PUSH_TO_BC_CANCEL			= 54013,			// QB 报价推送，推送给BC报价页面,注册取消
class xQBBondQuotePushReg_c{
public:
	char		m_BCCompanyID[32+1];			//机构ID，需要看的报价机构ID
};
//应答同54001，注销无应答

//--------------------------------------------------------
//E_FID_QB_BOND_QUOTE_AUTHORITY_REQ			= 54018,				// QB 报价权限查询，Tong
class xQBBondQuoteAuthorityReq_c {
public:
	char		m_QBUserID[32+1];				//用户ID
	char		m_QBCompanyID[32+1];			//机构ID
};

class xQBBondQuoteAuthorityAck_c{
public:
	char		m_QBUserID[32+1];				//用户ID
	char		m_QBCompanyID[32+1];			//机构ID
	int			m_QuoteAuthority;				//1--有权限，其他没有
	xQBBondQuoteAuthorityAck_c():m_QuoteAuthority(0)
	{
		m_QBUserID[0]='\0';
		m_QBCompanyID[0]='\0';
	}
};
